<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<script type="text/javascript">
	$(function() {
		parent.$.messager.progress('close');
		
		
		var comboboxExpress = $.parseJSON(sessionStorage.getItem("comboboxExpress"));
		$('#company_id').combobox({
			data:comboboxExpress,
			panelHeight:'auto'
		}); 
		
		$('#company_id').combobox('setValue', '${shOrders.companyId}');
		
		$('#status').combobox({
			data : [{"value":1,"text":"待取件"},
			        {"value":2,"text":"已取件"},
			        {"value":3,"text":"关闭"}],
		    panelHeight:'auto',
		    editable:false
		});
		
		$('#status').combobox('setValue', '${shOrders.status}');
		
		var amount = '${shOrders.amount}';
		
		
		if(amount != '') {
			$('#showAmount').val(amount/100);
		}
		
		$('#form').form({
			url : '/recevieCourier/edit',
			onSubmit : function() {
				var amount = $('#showAmount').val();
				$('#amount').val(amount*100);
				parent.$.messager.progress({
					title : '提示',
					text : '数据处理中，请稍后....'
				});
				var isValid = $(this).form('validate');
				if (!isValid) {
					parent.$.messager.progress('close');
				}
				return isValid;
			},
			success : function(result) {
				parent.$.messager.progress('close');
				result = $.parseJSON(result);
				parent.$.messager.alert("提示",result.msg, 'info');
				if (result.success) {
					parent.$.modalDialog.openner_dataGrid.datagrid('reload');
					parent.$.modalDialog.handler.dialog('close');
				}
			}
		});
		
		
	});
</script>
<div class="easyui-layout" data-options="fit:true,border:false">
	<div data-options="region:'center',border:false" title="" style="overflow: hidden;">
		<form id="form" method="post">
			<input name="id" type="hidden" value="${shOrders.id}" />
			<input name="srcAccountId" id="srcAccountId" type="hidden" value="${shOrders.srcAccountId}" />
			<input name="desAccountId" id="desAccountId" type="hidden" value="${shOrders.desAccountId}" />
			<table class="table table-hover table-condensed">
				<tr>
					<td colspan="4" style="font-weight: bold;">快递信息</td>
				</tr>
				<tr>
					<td>快递点</td>
					<td >
						<input name="companyId" id="company_id" style="width: 180px" required="required"/>
					</td>
				</tr>
				<tr>
					<td>快递单号</td>
					<td >
						<input name="outBizNum" type="text" style="width: 180px"  value="${shOrders.outBizNum}" required="required"/>
					</td>
					<td>订单名称</td>
					<td >
						<input name="name" type="text" style="width: 180px" value="${shOrders.name}" class="easyui-validatebox" required="required"/>
					</td>
				</tr>
				
				<tr>
					<td colspan="4" style="font-weight: bold;">收件人信息</td>
				</tr>
				<tr>
					<td>收件人名称</td>
					<td >
						<input name="desAccountName" id="desAccountName" type="text" style="width: 180px" class="easyui-validatebox"  value="${shOrders.desAccountName}"/>
					</td>
					<td>收件人手机号</td>
					<td >
						<input name="desMobile" type="text" style="width: 180px" class="easyui-validatebox mobile" data-options="validType:'isPhoneNumber'" required="required" value="${shOrders.desMobile}"/>
					</td>
				</tr>
				<tr>
<!-- 					<td>快递金额（元）</td> -->
<!-- 					<td > -->
<!-- 						<input id="showAmount" type="text" style="width: 180px" class="easyui-numberbox" precision="2" min="0" max="99999.99" value="0" /> -->
<!-- 						<input name="amount" id="amount" type="hidden" /> -->
<!-- 					</td> -->
					<td>快递状态</td>
					<td >
						<input name="status" id="status" type="text" style="width: 180px"  />
					</td>
					<td>快递提取码</td>
					<td>
						<textarea name="remark" rows="3" cols="10" style="width: 181px;height: 50px">${shOrders.remark}</textarea>
					</td>
				</tr>
				
			</table>
		</form>
	</div>
</div>